#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
using namespace std;
int main()
{
	int rows = 2, cols = 2;
	double** matrixA;
	double** matrixB;
	double** matrixC;
	matrixA = new double* [rows];
	matrixB = new double* [rows];
	matrixC = new double* [rows];
	for (int i = 0; i < rows; i++)
	{
		matrixA[i] = new double[cols];
	}
	for (int i = 0; i < rows; i++)
	{
		matrixB[i] = new double[cols];
	}
	for (int i = 0; i < rows; i++)
	{
		matrixC[i] = new double[cols];
	}

	matrixA[0][0] = 0.1;
	matrixA[0][1] = 0.2;
	matrixA[1][0] = 0.3;
	matrixA[1][1] = 0.4;
	matrixB[0][0] = 1.0;
	matrixB[0][1] = 2.0;
	matrixB[1][0] = 3.0;
	matrixB[1][1] = 4.0;
	for (int i = 0; i < rows; i++)
	{
		for (int j = 0; j < rows; j++)
		{
			matrixC[i][j] = matrixA[i][j] + matrixB[i][j];
		}
	}
	cout << "matrix: " << endl;
	cout << matrixC[0][0] << " " << matrixC[0][1] << endl;
	cout << matrixC[1][0] << " " << matrixC[1][1] << endl;

	for (int i = 0; i < rows; i++)
	{
		delete[] matrixA[i];
	}
	delete[] matrixA;
	for (int i = 0; i < rows; i++)
	{
		delete[] matrixB[i];
	}
	delete[] matrixB; 
	for (int i = 0; i < rows; i++)
	{
		delete[] matrixC[i];
	}
	delete[] matrixC;


	return 0;
}